const express = require('express')
const router = express.Router()

const article_handler = require('../router_handler/artcate')

const expressJoi = require('@escook/express-joi')

const { addart,deleteArt, searchArt,updateArt } = require('../ValidationRules/user')

router.get('/article',article_handler.articles)

router.post('/addart',expressJoi(addart),article_handler.addart)

router.get('/deleteArt/:id',expressJoi(deleteArt),article_handler.deleteArt)

router.get('/serchArt/:name',expressJoi(searchArt),article_handler.serchArt)

router.post('/updateArt',expressJoi(updateArt),article_handler.updateArt)

module.exports = router
